From ae2b3bb9677e2a189f62032d038ce22b2826419a Mon Sep 17 00:00:00 2001 From: Victor Vasiliev Date: Sat, 26 Jan 2008 18:45:54 +0000 Subject: [PATCH] Invalidate file cache on image redirects deletion --- includes/Article.php | 4 ++++ includes/SpecialUndelete.php | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/includes/Article.php b/includes/Article.php index cf05267d01..79b38e2c7f 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -2960,6 +2960,10 @@ class Article { if( $title->getNamespace() == NS_MEDIAWIKI) { $wgMessageCache->replace( $title->getDBkey(), false ); } + if( $title->getNamespace() == NS_IMAGE ) { + $update = new HTMLCacheUpdate( $title, 'imagelinks' ); + $update->doUpdate(); + } } /** diff --git a/includes/SpecialUndelete.php b/includes/SpecialUndelete.php index c08a77701a..7d43ebd63e 100644 --- a/includes/SpecialUndelete.php +++ b/includes/SpecialUndelete.php @@ -499,6 +499,11 @@ class PageArchive { wfRunHooks( 'ArticleUndelete', array( &$this->title, false ) ); Article::onArticleEdit( $this->title ); } + + if( $this->title->getNamespace() == NS_IMAGE ) { + $update = new HTMLCacheUpdate( $this->title, 'imagelinks' ); + $update->doUpdate(); + } } else { // Revision couldn't be created. This is very weird return self::UNDELETE_UNKNOWNERR; -- 2.20.1